package cn.bocweb.spinning.view.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import cn.bocweb.spinning.view.fragment.MyFileAllFragment;
import cn.bocweb.spinning.view.fragment.MyFileDocumentFragment;
import cn.bocweb.spinning.view.fragment.MyFileImgFragment;

/**
 * Created by chenchangxing on 15/12/22.
 */
public class MyFileAdapter extends FragmentPagerAdapter {
    public MyFileAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0: {
                return new MyFileAllFragment();
            }
            case 1: {
                return new MyFileDocumentFragment();
            }
            case 2: {
                return new MyFileImgFragment();
            }
        }
        return null;
    }

    @Override
    public int getCount() {
        return 3;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        switch (position) {
            case 0: {
                return "全部";
            }
            case 1: {
                return "文档";
            }
            case 2: {
                return "图片";
            }
        }
        return null;
    }
}
